---
- name: create configuration
  block:
    - name: create directory configuration
      file:
        path: "{{ APP.CONF.PATH }}"
        state: directory
        owner: "{{ app_user }}"
        group: "{{ app_user_group }}"
    - name: create file configuration
      file:
        path: "{{ APP.CONF.FILE }}"
        state: touch
        owner: "{{ app_user }}"
        group: "{{ app_user_group }}"
    - name: create configuration file app
      blockinfile:
        dest: "{{ APP.CONF.FILE }}"
        content: |
          test configuration file
    - name: update configuration file
      replace:
        path: "{{ APP.CONF.FILE }}"
        regexp: "(^test configuration file$)"
        replace: "file1"
      notify:
        - Install necessary utilities
        - Execute tree command
        - Print stdout_lines
  become: true
  become_user: "{{ app_user }}"
